/**
 * 
 */
package org.tiger.springboot.rocketMq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tiger.springboot.rocketMq.producer.RocketMqProducer;

/**
 * @author liuwenlai
 *
 */
@RestController
@RequestMapping("/rocketMqMessageRegister")
public class RocketMqMessageRegisterController {

	@Autowired
	private RocketMqProducer rocketMqProducer;

	@Value("${spring.rocketmq.subscribe}")
	private String subscribe;

	@Value("${spring.rocketmq.messageSelector}")
	private String messageSelector;

	@RequestMapping("/createProducer")
	public void createProducer(String data, String key) {

		rocketMqProducer.sendMessage(data, subscribe, messageSelector, key);

	}

}
